<script setup>
import {computed, reactive, toRefs} from "vue";

let person = reactive({
  surname: '张',
  name: '三',
})
let {surname, name} = toRefs(person)

let fullName = computed(function () {
  return person.surname + person.name
})
// 练习需求：
// 1.输入姓，自动获取姓的值
// 2.输入名，自动获取名的值
// 3.将姓和名自动拼接成全名


</script>

<template>
  <div class="container">
    <div>姓：<input type="text" v-model="surname"></div>
    <div>名：<input type="text" v-model="name"></div>
    <div>全名：<input type="text" :value="fullName"></div>
  </div>

</template>
